/*
 * @Description: 浪潮导出用车订单
 * @Version: 2.0
 * @Autor: 许国辉
 * @Date: 2023-05-19 08:24:06
 * @LastEditors: 许国辉
 * @LastEditTime: 2025-02-19 16:19:28
 */
import dayjs from 'dayjs';
import { BasicColumn } from '/@/components/Table';

export const comprehensiveCarColumns: BasicColumn[] = [
  {
    title: '终端类型',
    dataIndex: 'a0',
    width: 80,
    customRender({}) {
      return 'App';
    },
  },
  {
    title: '预订时间',
    dataIndex: 'a1',
    width: 170,
    customRender({ record }) {
      return dayjs(record.createTime).format('YYYY/MM/DD HH:mm:ss');
    },
  },
  {
    title: '预订人',
    dataIndex: 'a2',
    width: 80,
    customRender({ record }) {
      return record.reserveName;
    },
  },
  {
    title: '出差申请单号',
    dataIndex: 'a3',
    width: 180,
    customRender({ record }) {
      return record.externalApprovalNo ? record.externalApprovalNo : '-';
    },
  },
  {
    title: '订单号',
    dataIndex: 'a4',
    width: 190,
    customRender({ record }) {
      return record.orderNo;
    },
  },
  {
    title: '员工编号',
    dataIndex: 'a5',
    width: 80,
    customRender({ record }) {
      return record.accountNo;
    },
  },
  {
    title: '乘车人',
    dataIndex: 'a6',
    width: 80,
    customRender({ record }) {
      return record.orderDetailDto.passengerList[0].name;
    },
  },
  {
    title: '乘车人电话',
    dataIndex: 'a7',
    width: 120,
    customRender({ record }) {
      return record.orderDetailDto.passengerList[0].phone;
    },
  },
  {
    title: '上车地点',
    dataIndex: 'a8',
    width: 200,
    customRender({ record }) {
      return record.departCityName + '-' + record.departAddress;
    },
  },
  {
    title: '下车地点',
    dataIndex: 'a9',
    width: 200,
    customRender({ record }) {
      return record.arriveCityName + '-' + record.arriveAddress;
    },
  },
  {
    title: '用车时间',
    dataIndex: 'a10',
    width: 170,
    customRender({ record }) {
      return record.departureTime ? dayjs(record.departureTime).format('YYYY/MM/DD HH:mm:ss') : '-';
    },
  },
  {
    title: '抵达时间',
    dataIndex: 'a67',
    width: 180,
    customRender({ record }) {
      return record.finishTime ? dayjs(record.finishTime).format('YYYY/MM/DD HH:mm:ss') : '-';
    },
  },
  {
    title: '车型等级',
    dataIndex: 'a11',
    width: 90,
    customRender({ record }) {
      if (record.carCategory === 'COMFORT') return '舒适型';
      if (record.carCategory === 'ECONOMIC') return '经济型';
    },
  },
  {
    title: '供应商渠道',
    dataIndex: 'a12',
    width: 100,
    customRender({ record }) {
      return record.orderDetailDto.childChannelName ? record.orderDetailDto.childChannelName : '-';
    },
  },
  {
    title: '出差人数',
    dataIndex: 'a13',
    width: 80,
    customRender({ record }) {
      return record.orderDetailDto.passengerList.length;
    },
  },
  {
    title: '车费',
    dataIndex: 'a14',
    width: 80,
    customRender({ record }) {
      return record.realFee;
    },
  },
  {
    title: '深白云服务费',
    dataIndex: 'a15',
    width: 80,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '售票处服务费',
    dataIndex: 'a16',
    width: 80,
    customRender({}) {
      return 0;
    },
  },
  {
    title: '深白云扣款',
    dataIndex: 'a17',
    width: 80,
    customRender({ record }) {
      return record.realFee;
    },
  },
  {
    title: '应收总计',
    dataIndex: 'a18',
    width: 80,
    customRender({ record }) {
      return record.realFee;
    },
  },
  {
    title: '总金额包含服务费',
    dataIndex: 'a19',
    width: 80,
    customRender({ record }) {
      return record.realFee;
    },
  },
  {
    title: '车辆信息',
    dataIndex: 'a20',
    width: 180,
    customRender({ record }) {
      return record.orderDetailDto.driver ? record.orderDetailDto.driver.licensePlate : '-';
    },
  },
  {
    title: '订单类型',
    dataIndex: 'a21',
    width: 80,
    customRender({}) {
      return '有审批单';
    },
  },
  {
    title: '服务商编码',
    dataIndex: 'a22',
    width: 100,
    customRender({ record }) {
      return record.orderDetailDto.proxyId;
    },
  },
  {
    title: '客户名称',
    dataIndex: 'a23',
    width: 80,
    customRender({ record }) {
      return record.orderDetailDto.passengerList[0].name;
    },
  },
  {
    title: '客户编号',
    dataIndex: 'a24',
    width: 80,
    customRender({ record }) {
      return record.accountNo;
    },
  },
  {
    title: '收款状态',
    dataIndex: 'a25',
    width: 80,
    customRender({ record }) {
      return record.payStatus === 'UNPAID' ? '未支付' : '已支付';
    },
  },
  {
    title: '结算状态',
    dataIndex: 'a26',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '联系人',
    dataIndex: 'a27',
    width: 80,
    customRender({ record }) {
      return record.reserveName;
    },
  },
  {
    title: '联系人电话',
    dataIndex: 'a28',
    width: 120,
    customRender({ record }) {
      return record.orderDetailDto.passengerList[0].phone;
    },
  },
  {
    title: '成本中心',
    dataIndex: 'a29',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: 'OA申请单号',
    dataIndex: 'a30',
    width: 160,
    customRender({ record }) {
      return record.externalApprovalNo ? record.externalApprovalNo : '-';
    },
  },
  {
    title: '业务经理',
    dataIndex: 'a31',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '服务商名称',
    dataIndex: 'a32',
    width: 100,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '服务费',
    dataIndex: 'a33',
    width: 80,
    customRender({}) {
      return '0';
    },
  },
  {
    title: '供应商单号',
    dataIndex: 'a34',
    width: 100,
    customRender({ record }) {
      return record.orderDetailDto.channelOrderNo;
    },
  },
  {
    title: '订单来源',
    dataIndex: 'a35',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '预订人部门',
    dataIndex: 'a36',
    width: 100,
    customRender({ record }) {
      return record.departmentId ? record.departmentId : '-';
    },
  },
  {
    title: '支付状态',
    dataIndex: 'a37',
    width: 80,
    customRender({}) {
      return '已支付';
    },
  },
  {
    title: '支付方式',
    dataIndex: 'a38',
    width: 80,
    customRender({}) {
      return '月结';
    },
  },
  {
    title: '个人支付金额',
    dataIndex: 'a39',
    width: 120,
    customRender({}) {
      return '0';
    },
  },
  {
    title: '个人退款金额',
    dataIndex: 'a40',
    width: 120,
    customRender({}) {
      return '0';
    },
  },
  {
    title: '公司支付金额',
    dataIndex: 'a41',
    width: 120,
    customRender({ record }) {
      return record.realFee;
    },
  },
  {
    title: '公司退款金额',
    dataIndex: 'a42',
    width: 120,
    customRender({}) {
      return '0';
    },
  },
  {
    title: '交易流水号',
    dataIndex: 'a43',
    width: 100,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '费用承担部门',
    dataIndex: 'a44',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '项目编号',
    dataIndex: 'a45',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '项目名称',
    dataIndex: 'a46',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '差旅事项',
    dataIndex: 'a47',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '超标原因',
    dataIndex: 'a48',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '超标金额',
    dataIndex: 'a49',
    width: 80,
    customRender({}) {
      return '0';
    },
  },
  {
    title: '超标描述',
    dataIndex: 'a50',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '费用类型',
    dataIndex: 'a51',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '差旅授权号',
    dataIndex: 'a52',
    width: 100,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批状态',
    dataIndex: 'a53',
    width: 80,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '给审批人留言',
    dataIndex: 'a54',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组1类型',
    dataIndex: 'a55',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组1审批人',
    dataIndex: 'a56',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组2类型',
    dataIndex: 'a57',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组2审批人',
    dataIndex: 'a58',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组3类型',
    dataIndex: 'a59',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组3审批人',
    dataIndex: 'a60',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组4类型',
    dataIndex: 'a61',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '审批组4审批人',
    dataIndex: 'a62',
    width: 120,
    customRender({}) {
      return '-';
    },
  },
  {
    title: '员工部门',
    dataIndex: 'a63',
    width: 80,
    customRender({ record }) {
      return record.departmentId ? record.departmentId : '-';
    },
  },
  {
    title: '消费记录id（唯一值）',
    dataIndex: 'a64',
    width: 100,
    customRender({ record }) {
      return 'car' + record.id;
    },
  },
  // {
  //   title: '订单号',
  //   dataIndex: 'a65',
  //   width: 200,
  //   customRender({ record }) {
  //     return record.orderNo;
  //   },
  // },
  // {
  //   title: '出发时间',
  //   dataIndex: 'a66',
  //   width: 180,
  //   customRender({ record }) {
  //     return record.departureTime ? dayjs(record.departureTime).format('YYYY/MM/DD HH:mm:ss') : '-';
  //   },
  // },
  // {
  //   title: '到达时间',
  //   dataIndex: 'a67',
  //   width: 180,
  //   customRender({ record }) {
  //     return record.finishTime ? dayjs(record.finishTime).format('YYYY/MM/DD HH:mm:ss') : '-';
  //   },
  // },
  {
    title: '乘车人卡号',
    dataIndex: 'a68',
    width: 100,
    customRender({ record }) {
      return record.orderDetailDto.passengerList[0].certNo
        ? record.orderDetailDto.passengerList[0].certNo
        : '-';
    },
  },
];
